<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>apiclient.discovery</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="apiclient-module.html">Package&nbsp;apiclient</a> ::
        Module&nbsp;discovery
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="apiclient.discovery-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module discovery</h1><p class="nomargin-top"><span class="codelink"><a href="apiclient.discovery-pysrc.html">source&nbsp;code</a></span></p>
<pre class="literalblock">
Client for discovery based APIs

A client library for Google's discovery based APIs.

</pre>

<hr />
<div class="fields">      <p><strong>Author:</strong>
        jcgregorio@google.com (Joe Gregorio)
      </p>
</div><!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Classes"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="apiclient.discovery.Resource-class.html" class="summary-name">Resource</a><br />
      A class for interacting with a resource.
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#fix_method_name" class="summary-sig-name">fix_method_name</a>(<span class="summary-sig-arg">name</span>)</span><br />
      Fix method names to avoid reserved word conflicts.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#fix_method_name">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#_add_query_parameter" class="summary-sig-name" onclick="show_private();">_add_query_parameter</a>(<span class="summary-sig-arg">url</span>,
        <span class="summary-sig-arg">name</span>,
        <span class="summary-sig-arg">value</span>)</span><br />
      Adds a query parameter to a url.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#_add_query_parameter">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#key2param" class="summary-sig-name">key2param</a>(<span class="summary-sig-arg">key</span>)</span><br />
      Converts key names into parameter names.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#key2param">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#build" class="summary-sig-name">build</a>(<span class="summary-sig-arg">serviceName</span>,
        <span class="summary-sig-arg">version</span>,
        <span class="summary-sig-arg">http</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">discoveryServiceUrl</span>=<span class="summary-sig-default">DISCOVERY_URI</span>,
        <span class="summary-sig-arg">developerKey</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">model</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">requestBuilder</span>=<span class="summary-sig-default">HttpRequest</span>)</span><br />
      Construct a Resource for interacting with an API.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#build">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#build_from_document" class="summary-sig-name">build_from_document</a>(<span class="summary-sig-arg">service</span>,
        <span class="summary-sig-arg">base</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">future</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">http</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">developerKey</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">model</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">requestBuilder</span>=<span class="summary-sig-default">HttpRequest</span>)</span><br />
      Create a Resource for interacting with an API.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#build_from_document">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#_cast" class="summary-sig-name" onclick="show_private();">_cast</a>(<span class="summary-sig-arg">value</span>,
        <span class="summary-sig-arg">schema_type</span>)</span><br />
      Convert value to a string based on JSON Schema type.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#_cast">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#_media_size_to_long" class="summary-sig-name" onclick="show_private();">_media_size_to_long</a>(<span class="summary-sig-arg">maxSize</span>)</span><br />
      Convert a string media size, such as 10GB or 3TB into an integer.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#_media_size_to_long">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#createMethod" class="summary-sig-name">createMethod</a>(<span class="summary-sig-arg">methodName</span>,
        <span class="summary-sig-arg">methodDesc</span>,
        <span class="summary-sig-arg">rootDesc</span>,
        <span class="summary-sig-arg">schema</span>)</span><br />
      Creates a method for attaching to a Resource.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#createMethod">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="apiclient.discovery-module.html#createNextMethod" class="summary-sig-name">createNextMethod</a>(<span class="summary-sig-arg">methodName</span>)</span><br />
      Creates any _next methods for attaching to a Resource.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="apiclient.discovery-pysrc.html#createNextMethod">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="copy"></a><span class="summary-name">copy</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="httplib2"></a><span class="summary-name">httplib2</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="logging"></a><span class="summary-name">logging</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="os"></a><span class="summary-name">os</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="re"></a><span class="summary-name">re</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="uritemplate"></a><span class="summary-name">uritemplate</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="urllib"></a><span class="summary-name">urllib</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="urlparse"></a><span class="summary-name">urlparse</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="mimeparse"></a><span class="summary-name">mimeparse</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="mimetypes"></a><span class="summary-name">mimetypes</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="parse_qsl"></a><span class="summary-name">parse_qsl</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="HttpError"></a><span class="summary-name">HttpError</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="InvalidJsonError"></a><span class="summary-name">InvalidJsonError</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="MediaUploadSizeError"></a><span class="summary-name">MediaUploadSizeError</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="UnacceptableMimeTypeError"></a><span class="summary-name">UnacceptableMimeTypeError</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="UnknownApiNameOrVersion"></a><span class="summary-name">UnknownApiNameOrVersion</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="UnknownFileType"></a><span class="summary-name">UnknownFileType</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="HttpRequest"></a><span class="summary-name">HttpRequest</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="MediaFileUpload"></a><span class="summary-name">MediaFileUpload</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="MediaUpload"></a><span class="summary-name">MediaUpload</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="JsonModel"></a><span class="summary-name">JsonModel</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="MediaModel"></a><span class="summary-name">MediaModel</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="RawModel"></a><span class="summary-name">RawModel</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="Schemas"></a><span class="summary-name">Schemas</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="MIMEMultipart"></a><span class="summary-name">MIMEMultipart</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="MIMENonMultipart"></a><span class="summary-name">MIMENonMultipart</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="positional"></a><span class="summary-name">positional</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="simplejson"></a><span class="summary-name">simplejson</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="logger"></a><span class="summary-name">logger</span> = <code title="logging.getLogger(__name__)">logging.getLogger(__name__)</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="URITEMPLATE"></a><span class="summary-name">URITEMPLATE</span> = <code title="re.compile('{[^}]*}')">re.compile('{[^}]*}')</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="VARNAME"></a><span class="summary-name">VARNAME</span> = <code title="re.compile('[a-zA-Z0-9_-]+')">re.compile('[a-zA-Z0-9_-]+')</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="apiclient.discovery-module.html#DISCOVERY_URI" class="summary-name">DISCOVERY_URI</a> = <code title="'https://www.googleapis.com/discovery/v1/apis/' '{api}/{apiVersion}/re\
st'">'https://www.googleapis.com/discovery/v1/apis/<code class="variable-ellipsis">...</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="DEFAULT_METHOD_DOC"></a><span class="summary-name">DEFAULT_METHOD_DOC</span> = <code title="'A description of how to use this function'">'A description of how to use this function'</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="STACK_QUERY_PARAMETERS"></a><span class="summary-name">STACK_QUERY_PARAMETERS</span> = <code title="['trace', 'pp', 'userip', 'strict']">['trace', 'pp', 'userip', 'strict']</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="apiclient.discovery-module.html#RESERVED_WORDS" class="summary-name">RESERVED_WORDS</a> = <code title="['and', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', \
'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'i\
mport', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', '\
return', 'try', 'while', 'body']">['and', 'assert', 'break', 'class', 'continue<code class="variable-ellipsis">...</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="apiclient.discovery-module.html#MULTIPLIERS" class="summary-name">MULTIPLIERS</a> = <code title="{&quot;KB&quot;: 2** 10, &quot;MB&quot;: 2** 20, &quot;GB&quot;: 2** 30, &quot;TB&quot;: 2** 40,}">{&quot;KB&quot;: 2** 10, &quot;MB&quot;: 2** 20, &quot;GB&quot;: 2** 30, &quot;TB&quot;:<code class="variable-ellipsis">...</code></code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="fix_method_name"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">fix_method_name</span>(<span class="sig-arg">name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#fix_method_name">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Fix method names to avoid reserved word conflicts.

Args:
  name: string, method name.

Returns:
  The name with a '_' prefixed if the name is a reserved word.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="_add_query_parameter"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_add_query_parameter</span>(<span class="sig-arg">url</span>,
        <span class="sig-arg">name</span>,
        <span class="sig-arg">value</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#_add_query_parameter">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Adds a query parameter to a url.

Replaces the current value if it already exists in the URL.

Args:
  url: string, url to add the query parameter to.
  name: string, query parameter name.
  value: string, query parameter value.

Returns:
  Updated query parameter. Does not update the url if value is None.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="key2param"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">key2param</span>(<span class="sig-arg">key</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#key2param">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Converts key names into parameter names.

For example, converting &quot;max-results&quot; -&gt; &quot;max_results&quot;

Args:
  key: string, the method key name.

Returns:
  A safe method name based on the key name.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="build"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">build</span>(<span class="sig-arg">serviceName</span>,
        <span class="sig-arg">version</span>,
        <span class="sig-arg">http</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">discoveryServiceUrl</span>=<span class="sig-default">DISCOVERY_URI</span>,
        <span class="sig-arg">developerKey</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">model</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">requestBuilder</span>=<span class="sig-default">HttpRequest</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#build">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Construct a Resource for interacting with an API.

Construct a Resource object for interacting with an API. The serviceName and
version are the names from the Discovery service.

Args:
  serviceName: string, name of the service.
  version: string, the version of the service.
  http: httplib2.Http, An instance of httplib2.Http or something that acts
    like it that HTTP requests will be made through.
  discoveryServiceUrl: string, a URI Template that points to the location of
    the discovery service. It should have two parameters {api} and
    {apiVersion} that when filled in produce an absolute URI to the discovery
    document for that service.
  developerKey: string, key obtained from
    https://code.google.com/apis/console.
  model: apiclient.Model, converts to and from the wire format.
  requestBuilder: apiclient.http.HttpRequest, encapsulator for an HTTP
    request.

Returns:
  A Resource object with methods for interacting with the service.

</pre>
  <dl class="fields">
    <dt>Decorators:</dt>
    <dd><ul class="nomargin-top">
        <li><code>@positional(2)</code></li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="build_from_document"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">build_from_document</span>(<span class="sig-arg">service</span>,
        <span class="sig-arg">base</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">future</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">http</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">developerKey</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">model</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">requestBuilder</span>=<span class="sig-default">HttpRequest</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#build_from_document">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Create a Resource for interacting with an API.

Same as `build()`, but constructs the Resource object from a discovery
document that is it given, as opposed to retrieving one over HTTP.

Args:
  service: string or object, the JSON discovery document describing the API.
    The value passed in may either be the JSON string or the deserialized
    JSON.
  base: string, base URI for all HTTP requests, usually the discovery URI.
    This parameter is no longer used as rootUrl and servicePath are included
    within the discovery document. (deprecated)
  future: string, discovery document with future capabilities (deprecated).
  http: httplib2.Http, An instance of httplib2.Http or something that acts
    like it that HTTP requests will be made through.
  developerKey: string, Key for controlling API usage, generated
    from the API Console.
  model: Model class instance that serializes and de-serializes requests and
    responses.
  requestBuilder: Takes an http request and packages it up to be executed.

Returns:
  A Resource object with methods for interacting with the service.

</pre>
  <dl class="fields">
    <dt>Decorators:</dt>
    <dd><ul class="nomargin-top">
        <li><code>@positional(1)</code></li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="_cast"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_cast</span>(<span class="sig-arg">value</span>,
        <span class="sig-arg">schema_type</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#_cast">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Convert value to a string based on JSON Schema type.

See http://tools.ietf.org/html/draft-zyp-json-schema-03 for more details on
JSON Schema.

Args:
  value: any, the value to convert
  schema_type: string, the type that value should be interpreted as

Returns:
  A string representation of 'value' based on the schema_type.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="_media_size_to_long"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_media_size_to_long</span>(<span class="sig-arg">maxSize</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#_media_size_to_long">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Convert a string media size, such as 10GB or 3TB into an integer.

Args:
  maxSize: string, size as a string, such as 2MB or 7GB.

Returns:
  The size as an integer value.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="createMethod"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">createMethod</span>(<span class="sig-arg">methodName</span>,
        <span class="sig-arg">methodDesc</span>,
        <span class="sig-arg">rootDesc</span>,
        <span class="sig-arg">schema</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#createMethod">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Creates a method for attaching to a Resource.

Args:
  methodName: string, name of the method to use.
  methodDesc: object, fragment of deserialized discovery document that
    describes the method.
  rootDesc: object, the entire deserialized discovery document.
  schema: object, mapping of schema names to schema descriptions.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="createNextMethod"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">createNextMethod</span>(<span class="sig-arg">methodName</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="apiclient.discovery-pysrc.html#createNextMethod">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Creates any _next methods for attaching to a Resource.

The _next methods allow for easy iteration through list() responses.

Args:
  methodName: string, name of the method to use.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== VARIABLES DETAILS ==================== -->
<a name="section-VariablesDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-VariablesDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="DISCOVERY_URI"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">DISCOVERY_URI</h3>
  
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
'https://www.googleapis.com/discovery/v1/apis/' '{api}/{apiVersion}/re<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
st'
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<a name="RESERVED_WORDS"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">RESERVED_WORDS</h3>
  
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
['and', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', <span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'i<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
mport', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', '<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
return', 'try', 'while', 'body']
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<a name="MULTIPLIERS"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">MULTIPLIERS</h3>
  
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
{&quot;KB&quot;: 2** 10, &quot;MB&quot;: 2** 20, &quot;GB&quot;: 2** 30, &quot;TB&quot;: 2** 40,}
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Jan 24 16:14:31 2013
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
